<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no" />
		<title>首页</title>
		<link rel="stylesheet" type="text/css" href="../c/aui.css" />
		<link rel="stylesheet" type="text/css" href="../c/swiper.min.css" />
		<link rel="stylesheet" type="text/css" href="../c/suxiangw.css" />
		<style>
			html,body,.swiper-container {
				width: 100%;
				height: 100%;
			}
			.swiper-slide {
				text-align: center;
				font-size: 18px;
				background: #fff;
				/* Center slide text vertically */
				display: -webkit-box;
				display: -ms-flexbox;
				display: -webkit-flex;
				display: flex;
				-webkit-box-pack: center;
				-ms-flex-pack: center;
				-webkit-justify-content: center;
				justify-content: center;
				-webkit-box-align: center;
				-ms-flex-align: center;
				-webkit-align-items: center;
				align-items: center;
			}
		</style>
	</head>
	<body>
		<div class="swiper-container sx-index">
			<div class="swiper-wrapper">
				<div class="swiper-slide" style="background:#ccc">
					<div class="sx-right">
						<div class="sx-user">
							<img src="../i/logo.png" />
							<em></em>
						</div>
						<div class="sx-zan">
							<img src="../i/zan-s.png" />
							<p>156</p>
						</div>
						<div class="sx-ping">
							<img src="../i/ping.png" />
							<p>121</p>
						</div>
						<div class="sx-fen">
							<img src="../i/fen.png" />
							<p>分享</p>
						</div>
					</div>
					<div class="sx-bottom">
						<div class="sx-content">
							挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的
						</div>
					</div>
				</div>
				<div class="swiper-slide" style="background:#000">
					<div class="sx-right">
						<div class="sx-user">
							<img src="../i/logo.png" />
							<em></em>
						</div>
						<div class="sx-zan">
							<img src="../i/zan.png" />
							<p>156</p>
						</div>
						<div class="sx-ping">
							<img src="../i/ping.png" />
							<p>121</p>
						</div>
						<div class="sx-fen">
							<img src="../i/fen.png" />
							<p>分享</p>
						</div>
					</div>
					<div class="sx-bottom">
						<div class="sx-content">
							挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的
						</div>
					</div>
				</div><div class="swiper-slide" style="background:#000">
					<div class="sx-right">
						<div class="sx-user">
							<img src="../i/logo.png" />
							<em></em>
						</div>
						<div class="sx-zan">
							<img src="../i/zan.png" />
							<p>156</p>
						</div>
						<div class="sx-ping">
							<img src="../i/ping.png" />
							<p>121</p>
						</div>
						<div class="sx-fen">
							<img src="../i/fen.png" />
							<p>分享</p>
						</div>
					</div>
					<div class="sx-bottom">
						<div class="sx-content">
							挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的
						</div>
					</div>
				</div><div class="swiper-slide" style="background:#000">
					<div class="sx-right">
						<div class="sx-user">
							<img src="../i/logo.png" />
							<em></em>
						</div>
						<div class="sx-zan">
							<img src="../i/zan.png" />
							<p>156</p>
						</div>
						<div class="sx-ping">
							<img src="../i/ping.png" />
							<p>121</p>
						</div>
						<div class="sx-fen">
							<img src="../i/fen.png" />
							<p>分享</p>
						</div>
					</div>
					<div class="sx-bottom">
						<div class="sx-content">
							挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的挑战10秒流量，哈哈我也是够闲的
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../j/swiper.min.js"></script>
	<script type="text/javascript" src="../j/api.js"></script>
	<script src="../j/jquery-3.3.1.min.js"></script>
	<script type="text/javascript">
		var mySwiper, UIPLPlayer
		var activeIndex = 0;
		window.location.href="new_index.html";
		// 数量
		apiready = function() {
			
			urls();
			// 回到屏幕
			api.addEventListener({
				name : 'viewappear'
			}, function(ret, err) {
				api.setFullScreen({
				    fullScreen: true
				});
			});
			// 离开屏幕
			api.addEventListener({
				name : 'viewdisappear'
			}, function(ret, err) {

			});
			//应用进入后台事件
			api.addEventListener({
				name : 'pause'
			}, function(ret, err) {

			});
			// 应用从后台回到前台事件
			api.addEventListener({
				name : 'resume'
			}, function(ret, err) {

			});
			index_open();
			UIPLPlayer = api.require('UIPLPlayer');
				UIPLPlayer.addEventListener(function(ret, err) {
					console.log("addEventListener" + JSON.stringify(ret));
				});
			video_data = [{
				uid : new Date().getTime() + 1,
				imageUrl : 'http://img.news.suxiangw.com/0d4ae8b82fe354e41db482195d68e935.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/034e044b99b5c7dc5f43a8b75b0996f5.mp4'
			}, {
				uid : new Date().getTime() + 2,
				imageUrl : 'http://img.news.suxiangw.com/7b011d815094239ed4283ffb90797103.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/2e1fda5b984cdf013ec128227413ee5d.mp4'
			}, {
				uid : new Date().getTime() + 3,
				imageUrl : 'http://img.news.suxiangw.com/bd62344e68b2448f00edd43ff177fc7e.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/0c934847de7dc46814ab33c604074707.mp4'
			}, {
				uid : new Date().getTime() + 4,
				imageUrl : 'http://img.news.suxiangw.com/e9212d7956cabc6a9be8a19d3348bc2b.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/d0498c06e362f196cdfb73265fc4ea1f.mp4'
			}, {
				uid : new Date().getTime() + 5,
				imageUrl : 'http://img.news.suxiangw.com/e9212d7956cabc6a9be8a19d3348bc2b.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/034e044b99b5c7dc5f43a8b75b0996f5.mp4'
			}, {
				uid : new Date().getTime() + 1,
				imageUrl : 'http://img.news.suxiangw.com/0d4ae8b82fe354e41db482195d68e935.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/034e044b99b5c7dc5f43a8b75b0996f5.mp4'
			}, {
				uid : new Date().getTime() + 2,
				imageUrl : 'http://img.news.suxiangw.com/7b011d815094239ed4283ffb90797103.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/2e1fda5b984cdf013ec128227413ee5d.mp4'
			}, {
				uid : new Date().getTime() + 3,
				imageUrl : 'http://img.news.suxiangw.com/bd62344e68b2448f00edd43ff177fc7e.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/0c934847de7dc46814ab33c604074707.mp4'
			}, {
				uid : new Date().getTime() + 4,
				imageUrl : 'http://img.news.suxiangw.com/e9212d7956cabc6a9be8a19d3348bc2b.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/d0498c06e362f196cdfb73265fc4ea1f.mp4'
			}, {
				uid : new Date().getTime() + 5,
				imageUrl : 'http://img.news.suxiangw.com/e9212d7956cabc6a9be8a19d3348bc2b.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/034e044b99b5c7dc5f43a8b75b0996f5.mp4'
			}, {
				uid : new Date().getTime() + 1,
				imageUrl : 'http://img.news.suxiangw.com/0d4ae8b82fe354e41db482195d68e935.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/034e044b99b5c7dc5f43a8b75b0996f5.mp4'
			}, {
				uid : new Date().getTime() + 2,
				imageUrl : 'http://img.news.suxiangw.com/7b011d815094239ed4283ffb90797103.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/2e1fda5b984cdf013ec128227413ee5d.mp4'
			}, {
				uid : new Date().getTime() + 3,
				imageUrl : 'http://img.news.suxiangw.com/bd62344e68b2448f00edd43ff177fc7e.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/0c934847de7dc46814ab33c604074707.mp4'
			}, {
				uid : new Date().getTime() + 4,
				imageUrl : 'http://img.news.suxiangw.com/e9212d7956cabc6a9be8a19d3348bc2b.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/d0498c06e362f196cdfb73265fc4ea1f.mp4'
			}, {
				uid : new Date().getTime() + 5,
				imageUrl : 'http://img.news.suxiangw.com/e9212d7956cabc6a9be8a19d3348bc2b.jpg?imageView2/1/w/' + api.winWidth + '/h/' + api.winHeight + '/format/jpg',
				videoUrl : 'http://img.news.suxiangw.com/034e044b99b5c7dc5f43a8b75b0996f5.mp4'
			}];

			// 适配处理结束
			mySwiper = new Swiper('.swiper-container', {
				direction : 'vertical',
				on : {
					// 当碰触到slider时执行
					touchStart : function(event) {
						//console.log(event);
					},
					// 手指触碰Swiper并滑动（手指）时执行
					touchMove : function(event) {
						//	console.log(event);
						//	console.log(this.activeIndex);
						//	console.log($('.swiper-slide').length);
					},
					// 回调函数，触摸释放时执行
					touchEnd : function(event) {
						//	console.log(event);
					},
					// 回调函数，swiper从当前slide开始过渡到另一个slide时执行。
					slideChangeTransitionStart : function() {
						//	console.log(this.activeIndex);
					},
					// 回调函数，swiper从一个slide过渡到另一个slide结束时执行。
					slideChangeTransitionEnd : function() {
						//						console.log(_this.data('id'));
						//						console.log(_this.data('video'));
						console.log(this.activeIndex + ":" + activeIndex)
						console.log(video_data[this.activeIndex].videoUrl)
						UIPLPlayer.switchPlayUrl({
							url : video_data[this.activeIndex].videoUrl,
						});
						//					if (this.activeIndex >= activeIndex) {
						//						//	console.log('加载新数据')
						//						// 添加新数据
						//						addSlide();
						//					}
						// 判断是否超出数量
						//	removeSlide();
						var a_this = $('.swiper-slide-active');
						// 更新sx数据
						sx = a_this.data('data');
						//	console.log(JSON.stringify(sx));
					},
				},
			});

		}
		// 打开底部
		function index_open(url){
			url = 'index_footer'
			api.openFrame({
				name : url,
				url : _h_w + url + '.html',
				rect : {
					x : 0,
					y : 0,
					w : 'auto',
					h : 0,
				},
				bgColor : 'rgba(0,0,0,0)',
			})
		}
		function a() {
			UIPLPlayer.openPlayer({
				rect : {
					x : 0,
					y : 0,
					w : 320,
					h : 250
				},
				videoUrlPath : 'http://img.news.suxiangw.com/034e044b99b5c7dc5f43a8b75b0996f5.mp4',
				fixedOn : api.frameName,
				fixed : false
			}, function(ret, err) {
				if (ret) {
					alert(JSON.stringify(ret));
				} else {
					alert(JSON.stringify(err));
				}
			});
		}
	</script>
</html>
